<%@ page pageEncoding="UTF-8" contentType="text/html;charset=UTF-8" isELIgnored="false" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<title>展示图书信息</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/css/style.css" />
		<style>
			li{
				float: left;
				list-style: none;
			}
		</style>
	</head>
	<body>
		<div id="wrap">
			<div id="top_content">
				<div id="header">
					<div id="rightheader">
						<p>
							2009/11/20
							<br />
							${sessionScope}
						</p>
					</div>
					<div id="topheader">
						<h1 id="title">
							<a href="#">main</a>
						</h1>
					</div>
					<div id="navigation">
					</div>
				</div>
				<div id="content">
					<p id="whereami">
					</p>
					<h1>
						Welcome!
					</h1>
					<form method="post" action="${pageContext.request.contextPath}/Book/detelesBook.do">
					<table class="table">
						<tr class="table_header">
						    <td>
							   	全选
							</td>
							<td>
								编号
							</td>
							<td>
								图书名称
							</td>
							<td>
								图书价格
							</td>
							<td>
								作者
							</td>
							<td>
								入库时间
							</td>
							<td>
								类别名称
							</td>
							<td>
								操作
							</td>
						</tr>
						<c:forEach items="${requestScope.categories}" var="c">
							<c:forEach items="${c.bookList}" var="b">
							<tr>
								<td>
									<input type="checkbox" name="ids" value="${b.book_id}"/>
								</td>
								<td>
									${b.book_id}
								</td>
								<td>
									${b.book_name}
								</td>
								<td>
									${b.book_price}
								</td>
								<td>
									${b.author}
								</td>
								<td>
									${b.add_time}
								</td>
								<td>
									${c.category_name}
								</td>
								<td>
									<a href="${pageContext.request.contextPath}/Book/deteleBook.do?id=${b.book_id}">删除图书</a>&nbsp;
									<a href="${pageContext.request.contextPath}/updateBook.jsp?book_id=${b.book_id}&book_name=${b.book_name}&book_price=${b.book_price}&author=${b.author}&add_time=${b.add_time}&category_id=${c.book_count}">修改图书</a>
								</td>
							</tr>
							</c:forEach>
						</c:forEach>
					</table>
					  <input type="submit" value="删除勾选项"/>
					</form>
					<c:if test="${pageNo == 1}">
						<li><a href="#">上一页</a></li>&nbsp;
					</c:if>
					<c:if test="${pageNo!=1}">
						<li><a href="${pageContext.request.contextPath}/Book/AllBook.do?pageNo=${pageNo-1}">上一页</a></li>&nbsp;
					</c:if>
					<li><a href="#" class="btn btn-default active disabled">第${requestScope.pageNo}页</a></li>&nbsp;
					<c:if test="${pageNo ==requestScope.totalPage}">
						<li><a href="#">下一页</a></li>&nbsp;
					</c:if>
					<c:if test="${pageNo < requestScope.totalPage}">
						<li><a href="${pageContext.request.contextPath}/Book/AllBook.do?pageNo=${pageNo+1}">下一页</a></li>&nbsp;
					</c:if>
					<p>
						<a href="${pageContext.request.contextPath}/addBook.jsp">添加图书</a>
						<a href="${pageContext.request.contextPath}/Category/AllCategory.do">查看所有类别</a>
					</p>
				</div>
			</div>
			<div id="footer">
				<div id="footer_bg">
				ABC@126.com
				</div>
			</div>
		</div>
	</body>
</html>
